import requests


class ImgUpload:
    def __init__(self, cookies, requestverificationtoken):
        self.cookies = cookies
        self.requestverificationtoken = requestverificationtoken

    def upload(self, file):
        headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) '
                          'Chrome/122.0.0.0 Safari/537.36',
            'X-Requested-With': 'XMLHttpRequest'
        }

        url = 'https://spain.blscn.cn/CHN/query/UploadProfileImage'
        files = {'file': file}
        res = requests.post(url, cookies=self.cookies, files=files)
        print(res.json())